package Chapter2.Comparing.c7;

import java.util.Scanner;

public class BankDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("How many money would you deposit? ");

        CheckingAccount c = new CheckingAccount(101);

        //System.out.println("Depositing $500...");
        c.deposit(scanner.nextDouble());
        try{
            System.out.println("\n withdrawing how much");
            c.withdraw(scanner.nextDouble());
            System.out.println("\n withdrawing how much");
            c.withdraw(scanner.nextDouble());
        }
        catch (InsufficientFundsException e) {
            System.out.println("Sorry, but you are short $" + e.getAmount());
            //e.printStackTrace();
        }
    }

}
